﻿@using Model;
@using BLL;
@{
    CategoryBLL catebll = new CategoryBLL();
    TagBLL tagbll = new TagBLL();
    Blog m = ViewBag.model;
    ViewBag.Title = m.blog_title;
}
<link href="/Content/css/plugins/syntaxhighlighter/shCoreDefault.pack.css" rel="stylesheet" />

<section id="content">
    <article class="hentry">
        <h1 class="post-title">
            @m.blog_title
        </h1>
        <div class="entrymeta">
            <p>
                <i class="fa fa-user"></i> <span>@m.mem_name</span>
                <i class="fa fa-calendar"></i> <span>@m.blog_strtime</span>
                <i class="fa fa-share-alt"></i> <span>@Html.Raw(catebll.GetCateName(m.blog_cate))</span>
                <i class="fa fa-tags"></i><span>@Html.Raw(tagbll.GetTagName(m.blog_tags))</span>
            </p>
        </div>
        <div id="blog_content" style="width: 735px;">
            @Html.Raw(m.blog_content)
        </div>
        <div style="border:1px solid #ddd; padding:10px 15px; margin:10px 0;line-height:24px; font-size:12px;background:#f8f8f8">
            <div><span style="color:red;">*</span>如有侵权请联系作者</div>
            <div>本文链接：<a rel="bookmark" title="@m.blog_title" href="http://www.feng70.com/html/@(m.blog_id).html">http://www.feng70.com/html/@(m.blog_id).html</a></div>
            <div>
                转载请注明来源：<a title="麒麟的博客" href="http://www.feng70.com" >麒麟的博客</a>
                <a rel="bookmark" title="@m.blog_title" href="http://www.feng70.com/html/@(m.blog_id).html">《@m.blog_title》</a>
            </div>
        </div>
    </article>
    
</section>

<script type='text/javascript' src='/Content/js/plugins/syntaxhighlighter/shCore.pack.js?ver=1'></script>
<script type='text/javascript' src='/Content/js/plugins/syntaxhighlighter/shAutoloader.js?ver=1'></script>
<script type='text/javascript'>
  $(document).ready(function(){
        SyntaxHighlighter.autoloader(
     ['js', 'jscript', 'javascript', '/Content/js/plugins/syntaxhighlighter/shBrushJScript.js'],
     ['bash','shell','/Content/js/plugins/syntaxhighlighter/shBrushBash.js'],
     ['css','/Content/js/plugins/syntaxhighlighter/shBrushCss.js'],
     ['xml','html','/Content/js/plugins/syntaxhighlighter/shBrushXml.js'],
     ['sql','/Content/js/plugins/syntaxhighlighter/shBrushSql.js'],
     ['php','/Content/js/plugins/syntaxhighlighter/shBrushPhp.js'],
     ['c#', '/Content/js/plugins/syntaxhighlighter/shBrushCSharp.js'],
     ['java', '/Content/js/plugins/syntaxhighlighter/shBrushJava.js']
 ); 
    SyntaxHighlighter.all();

    // Line wrap back
    var shLineWrap = function () {
        $('.syntaxhighlighter').each(function () {
            // Fetch
            var $sh = $(this),
                $gutter = $sh.find('td.gutter'),
                $code = $sh.find('td.code')
            ;
            // Cycle through lines
            $gutter.children('.line').each(function (i) {
                // Fetch
                var $gutterLine = $(this),
                    $codeLine = $code.find('.line:nth-child(' + (i + 1) + ')')
                ;
                //alert($gutterLine);
                // Fetch height
                var height = $codeLine.height() || 0;
                if (!height) {
                    height = 'auto';
                }
                else {
                    height = height += 'px';
                    //alert(height);
                }
                // Copy height over
                $gutterLine.attr('style', 'height: ' + height + ' !important'); // fix by Edi, for JQuery 1.7+ under Firefox 15.0
                //console.debug($gutterLine.height(), height, $gutterLine.text(), $codeLine);
            });
        });
    };
    // Line wrap back when syntax highlighter has done it's stuff
    var shLineWrapWhenReady = function () {
        if ($('.syntaxhighlighter').length === 0) {
            setTimeout(shLineWrapWhenReady, 10);
        }
        else {
            shLineWrap();
        }
    };
    // Fire
    shLineWrapWhenReady();
  });

</script>